<template>
	<view class="page-content">
		<f-navbar :title="pageTitle"></f-navbar>
		<view class="main-content">
			<richText :content="content" />
		</view>
	</view>
</template>

<script>
	import richText from "@/components/pageLayout/richText/index.vue"
	import {
		getRichText
	} from "@/api/common.js"
	export default {
		components: {
			richText
		},
		data() {
			return {
				pageData: {},
				content: ``,
				pageTitle: '',
			};
		},
		onShow() {

		},
		onLoad(option) {
			this.pageData = option
			this.getData()
		},
		methods: {
			getData() {
				let pageTitle;
				switch (this.pageData.type) {
					case 'aboutUs':
						pageTitle = "关于平台"
						this.getRichText('about_us')
						break;
					case 'problem':
						pageTitle = "常见问题"
						this.getRichText('FQA')
						break;
				}
				this.pageTitle = pageTitle
			},
			getRichText(configName) {
				getRichText(configName).then((response) => {
					this.content = response.data.content;
				})
			},
		}
	};
</script>

<style scoped lang="scss">
	.main-content {
		margin-top: 32rpx;
		padding: 40rpx;
		background: #ffffff;
	}
</style>